import Vue from 'vue'
import VueRouter from 'vue-router'

import app from '../views/login.vue'
import mian from '../components/mian.vue'
import profile from '../components/child/profile.vue'
import weather from '../components/child/weather.vue'
import device from '../components/child/device.vue'
import ddevice from '../components/child//device/device.vue'
import adevice from '../components/child/device/device_a.vue'
import bdevice from '../components/child/device/device_b.vue'
import cdevice from '../components/child/device/device_c.vue'
import plan from '../components/child/plan.vue'
import settings from '../components/child/settings.vue'

Vue.use(VueRouter)

export default new VueRouter({
  mode: 'history',
  routes: [
    {
      // 路由路径
      path: '/login',
      // 跳转组件
      component: app
    },
    {
      // 路由路径
      path: '/mian',
      // 跳转组件
      component: mian,
      children: [
        {path: '/mian/profile', component: profile},
        {path: '/mian/weather', component: weather},
        {path: '/mian/device',
          component: device,
          children: [
            {path: '/mian/device/device', component: ddevice},
            {path: '/mian/device/device_a', component: adevice},
            {path: '/mian/device/device_b', component: bdevice},
            {path: '/mian/device/device_c', component: cdevice}]},
        {path: '/mian/plan', component: plan},
        {path: '/mian/settings', component: settings}
      ]
    }
  ]

})
